package com.ruoyi.service.impl;

import com.ruoyi.domain.ReportItem;
import com.ruoyi.mapper.ReportItemMapper;
import com.ruoyi.service.ReportItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 工作内容服务实现类
 */
@Service
public class ReportItemServiceImpl implements ReportItemService {

    @Autowired
    private ReportItemMapper reportItemMapper;

    @Override
    public List<ReportItem> getReportItemsByReportId(Long reportId) {
        return reportItemMapper.getReportItemsByReportId(reportId);
    }

    @Override
    public void saveReportItems(List<ReportItem> reportItems) {
        if (reportItems != null && !reportItems.isEmpty()) {
            reportItemMapper.insertReportItems(reportItems);
        }
    }

    @Override
    public void deleteReportItemsByReportId(Long reportId) {
        reportItemMapper.deleteReportItemsByReportId(reportId);
    }
}
